// OutThread.cpp : implementation file
//

#include "stdafx.h"
#include "TestThread3.h"
#include "OutThread.h"
#include "conio.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COutThread
extern int bESCPressed;
extern int nCount;

IMPLEMENT_DYNCREATE(COutThread, CWinThread)

COutThread::COutThread()
{
}

COutThread::~COutThread()
{
}

BOOL COutThread::InitInstance()
{
	// TODO:  perform and per-thread initialization here
	return TRUE;
}

int COutThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(COutThread, CWinThread)
	//{{AFX_MSG_MAP(COutThread)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COutThread message handlers

int COutThread::Run() 
{
	// TODO: Add your specialized code here and/or call the base class
	do {
             bESCPressed = (_getch() == 27);
             printf("%d\n", nCount);
		} while (!bESCPressed);

	 
	return CWinThread::Run();
}
